package com.xls.box2023.adapter;

import android.content.Context;
import android.view.ViewGroup;

import com.lzz.bottomencapsulation.adapter.MvpBaseRecyclerAdapter;
import com.xls.box2023.entity.AppsRulesEntity;

import java.util.ArrayList;
import java.util.List;

import androidx.annotation.NonNull;

public class DuiHuanJiBiTabAdapter extends MvpBaseRecyclerAdapter<DuiHuanJiBiTabItemView> {
    ArrayList<AppsRulesEntity> datalist;
    String type;
    public DuiHuanJiBiTabAdapter(Context context,String type,ArrayList<AppsRulesEntity> datalist, OnItemClickListener onItemClickListener) {
        super(context, onItemClickListener);
        this.datalist=datalist;
        this.type=type;
    }

    @Override
    public void onBindView(@NonNull DuiHuanJiBiTabItemView holder, int position) {
        holder.setViewData(datalist.get(position));
        holder.initView();
    }

    @Override
    public void onBindView(DuiHuanJiBiTabItemView holder, int position, List<Object> payloads) {

    }

    @NonNull
    @Override
    public DuiHuanJiBiTabItemView onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new DuiHuanJiBiTabItemView(context,type,parent);
    }

    @Override
    public int getItemCount() {
        return datalist.size();
    }
}
